#include <iostream>
using namespace std;
int main()
{
	int left,i,len[12];
	int t=0,bank=0,sign=0,getback,final;
	for (i=0;i<12;i++)
	{
		cin>>len[i];
	}
	for (i=0;i<12;i++)
	{
		t = t + 300;
		t = t - len[i];
		if (t>=100)
		{
			bank = bank + (t / 100) * 100;
			t = t - (t / 100) * 100; 
		}
		else if (t<0)
		{
			cout<<"-"<<i+1<<endl;
			sign = 1;
			break;
		}
		else continue;
	}
	if (sign!=1)
	{
		 getback = bank + bank * 0.2;
		 final = getback + t;
		 cout<<final<<endl;
	}
	return 0;
}
